package cn.com.dcsgo.library.admin.service;

import cn.com.dcsgo.library.admin.domain.dto.PageDTO;
import cn.com.dcsgo.library.admin.domain.po.Book;
import cn.com.dcsgo.library.admin.domain.query.BookPageQuery;
import cn.com.dcsgo.library.admin.domain.request.AddBookCopiesRequest;
import cn.com.dcsgo.library.admin.domain.request.SaveBookRequest;
import cn.com.dcsgo.library.admin.domain.request.UpdateBookRequest;
import cn.com.dcsgo.library.admin.domain.vo.*;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @author Dcsgo
 * @since 2024-09-02
 */
public interface IBooksService extends IService<Book> {
    PageDTO<BookBorrowedOverviewVO> booksOverviewByPage(BookPageQuery  pageQuery);

    List<Long> queryCopiesIdsById(Long bookId);

    Long queryBorrowedCopiesNumberById(Long bookId);

    Long queryBorrowedNumberById(Long bookId);

    Long queryCopiesNumberById(Long bookId);

    Long save(SaveBookRequest request);

    boolean existsIsbn(String isbn);

    BookVO queryBookDetails(Long bookId);

    List<BookCopiesVO> queryCopiesDetails(Long bookId);

    Book updateBook(UpdateBookRequest request);

    void addBookCopies(AddBookCopiesRequest request);

    void removeBookCopies(List<Long> copiesIds);

    void removeBooks(List<Long> bookIds);
}
